 <script th:inline="javascript">
/*<![CDATA[*/

    function del(event,element){
        event.preventDefault();
          bootbox.confirm("您确定删除吗?", function(result) {
        if(result){
            var _id = $(element).attr("href").split("_")[0];
            var _page=$(element).attr("href").split("_")[1];
            var _viewState = $(element).attr("href").split('_')[2];
            var _cashCardPromotioinId = $("#hidden_cashCardPromotionId").val();

            BOSS.remoteCall('promotion/cashcard/deleteCashCard',$('#cashCard_grid'),{id:_id,cashCardPromotionId:_cashCardPromotioinId,page:_page,viewState:_viewState});
            }
        }); 
    }
    
/*]]>*/
</script>
<input id="hidden_cashCardPromotionId" type="hidden" th:value="${cashCardPromotionId}"/>
<table layout:fragment="cashCard_table" class="table table-striped table-bordered  table-advance table-hover" id="cashCard_grid">
    <thead>
        <tr>
            <th>编号</th>
            <th>发放类型</th>
            <th>现金卡卡号</th>
            <th>密码</th>
            <th>余额</th>
            <th>使用用户</th>
            <th>操作</th>
        </tr>
    </thead>    
    <tbody>
        <tr class="odd gradeX" th:each="data : ${cashCardPage}">
            <td th:text="${data.id}">
                编号
            </td>
            <td th:text="${data.bonusPromotion.grantType.description}">
                发放类型
            </td>
            <td th:text="${data.code}">
                现金卡卡号
            </td>
            <td th:text="${data.password}">
                密码
            </td>
            <td th:text="${data.leftPrice}">
                余额
            </td>
            <td th:text="${data.user} ? ${data.user.name} : '未绑定用户'">
                使用用户
            </td>
            <td>
                <a th:attr="id=${'link_delete_'+dataStat.index}" th:href="${data.id}+'_'+${cashCardPage.number}+'_'+${viewState}" onclick="del(event,this)">移除</a>
                <a th:attr="id=${'link_delete_'+dataStat.index}" th:href="@{'/promotion/cashcard/log/index/'+${cashCardPromotionId}+'/'+${data.id}}">日志</a>
            </td>         
        </tr>
     </tbody>
</table>

